package com.mybatis_test;

import java.sql.*;

public class JdbcDemo {
  static {
    try {
      Class.forName(Driver.class.getName());
    } catch (ClassNotFoundException e) {
      e.printStackTrace();
    }
  }

  public static void main(String[] args) throws Exception{
    Connection connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/test?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&useSSL=false", "root", "zhangxu");
    Statement statement = connection.createStatement();
    ResultSet resultSet = statement.executeQuery("select * from t1");
    while (resultSet.next()){
      System.out.println(resultSet.getString(2));
    }
  }
}
